package com.yk.faceapplication.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Message;

/**
 * Created by yk_2018/1/29_16:06
 */

public class SplushActivity extends BaseActivity {
    private final int DURAING = 2000;
    private final int GO_HOME = 1000;
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        sendMessageDelayed(GO_HOME,DURAING);
    }

    @Override
    protected void onHandleMessage(Message msg) {
        super.onHandleMessage(msg);
        if(msg.what == GO_HOME){
            if (!preferences.getBoolean("guide",false)) {
                startActivity(new Intent(SplushActivity.this,GuideActivity.class));
                editor.putBoolean("guide",true).commit();
            }else{
                startActivity(new Intent(SplushActivity.this,HomeActivity.class));
            }
            finishAct();
        }

    }
}
